
const _interopRequireDefault = require('@babel/runtime/helpers/interopRequireDefault');

exports.__esModule = true;
exports.default = void 0;

const _extends2 = _interopRequireDefault(require('@babel/runtime/helpers/extends'));

const _utils = require('../utils');

const _TimePicker = _interopRequireDefault(require('./TimePicker'));

const _DatePicker = _interopRequireDefault(require('./DatePicker'));

const _createNamespace = (0, _utils.createNamespace)('datetime-picker');
const createComponent = _createNamespace[0];
const bem = _createNamespace[1];

const _default = createComponent({
  props: (0, _extends2.default)({}, _TimePicker.default.props, {}, _DatePicker.default.props),
  methods: {
    // @exposed-api
    getPicker: function getPicker() {
      return this.$refs.root.getPicker();
    },
  },
  render: function render() {
    const h = arguments[0];
    const Component = this.type === 'time' ? _TimePicker.default : _DatePicker.default;
    return h(Component, {
      ref: 'root',
      class: bem(),
      props: (0, _extends2.default)({}, this.$props),
      on: (0, _extends2.default)({}, this.$listeners),
    });
  },
});

exports.default = _default;
